package com.tencent.sr.iris.activity.service.convert;

import com.tencent.sr.iris.activity.interfaces.response.activity.UserTaskRecordResponse;
import com.tencent.sr.iris.activity.repository.entity.TIrisUserTaskRecordDO;

/**
 * @author xiaojun
 */
public class UserTaskRecordConvert {

    public static UserTaskRecordResponse do2Response(TIrisUserTaskRecordDO recordDO) {
        UserTaskRecordResponse userTaskRecordResponse = new UserTaskRecordResponse();
        userTaskRecordResponse.setBizId(recordDO.getBizId());
        userTaskRecordResponse.setActivityId(recordDO.getActivityId());
        userTaskRecordResponse.setTaskId(recordDO.getTaskId());
        userTaskRecordResponse.setTaskPeriod(recordDO.getTaskPeriod());
        userTaskRecordResponse.setUid(recordDO.getUid());
        userTaskRecordResponse.setPid(recordDO.getPid());
        userTaskRecordResponse.setUserTaskStatus(recordDO.getUserTaskStatus());
        userTaskRecordResponse.setShareCount(recordDO.getShareCount());
        userTaskRecordResponse.setCommission(recordDO.getCommission());
        userTaskRecordResponse.setTotalShareCount(recordDO.getShareCount());
        userTaskRecordResponse.setTotalCommission(recordDO.getCommission());
        userTaskRecordResponse.setAwardType(null);
        userTaskRecordResponse.setAwardValue(null);
        userTaskRecordResponse.setActivityType(recordDO.getActivityType());
        userTaskRecordResponse.setCurrentTaskStartTime(recordDO.getCurrentTaskStartTime().getTime());
        userTaskRecordResponse.setCurrentTaskEndTime(recordDO.getCurrentTaskEndTime().getTime());
        userTaskRecordResponse.setCreateTime(String.valueOf(recordDO.getCreateTime()));
        userTaskRecordResponse.setTier(recordDO.getTier());
        userTaskRecordResponse.setEstimateCommission(recordDO.getEstimateCommission());
        userTaskRecordResponse.setEstimateUserTaskStatus(recordDO.getEstimateUserTaskStatus());
        userTaskRecordResponse.setGroupByExpression(null);
        return userTaskRecordResponse;
    }
}
